
export default function ({ $axios, redirect, req, store, route, app }) {
  app.router.afterEach((to, from) => {
    let index = store.state.navList.navActive;
    let  searchType = store.state.navList.searchType;
    if (to.path == '/') {
      index = 0
    } else if (to.path.includes("/examination")) {
      index = 1
    } else if (to.path.includes("/school")) {
      index = 2
      searchType='驾校'
    } else if (to.path.includes("/accompany")) {
      index = 4
      searchType='陪练'
    } else if (to.path.includes("/coach")) {
      index = 3
      searchType='教练'
    } else if (to.path.includes("/guide")) {
      index = 5
      searchType='指南'
    } else if (to.path.includes("/signs")) {
      index = 6
    }
    store.commit('navList/SET_NAVACTIVE', index)
  })
}

